package com.gengine.resource.loader
{
	import com.gengine.resource.core.*;
	import com.gengine.resource.info.*;
	import flash.events.*;
	
	public class BaseLoader extends StreamLoader
	{
		public var data:Object;
		public var resourceInfo:ResourceInfo;
		
		public function BaseLoader()
		{
		}
		
		public function getClass() : Class
		{
			return BaseLoader;
		}
		
		override protected function onIOErrorHandler(event:ErrorEvent) : void
		{
			if (this.resourceInfo)
			{
				this.resourceInfo.isLoaded = false;
				this.resourceInfo.isLoading = false;
			}
			super.onIOErrorHandler(event);
		}
		
		override protected function onLoadCompleteHandler() : void
		{
			if (this.resourceInfo)
			{
				this.resourceInfo.isLoaded = true;
				this.resourceInfo.isLoading = false;
			}
			super.onLoadCompleteHandler();
		}
	}
}
